@extends('layout.default')

@section('layout.content')

  <div class="row">
    <div class="col-xs-12 align-right">
      <div style="margin-bottom: 15px;">
        <a href="{{route('activity.create')}}" class="btn btn-lg btn-danger"><i class="ace-icon fa fa-user-plus"></i>活动发布</a>
      </div>
    </div> 
  </div><!-- /.row -->
  
  <div class="row">    
    <div class="col-xs-12 col-md-6">
      <table class="table table-hover table-striped table-bordered nonborder">
        <thead>
        <tr>
          <th class="align-middle">主题</th>
          <th class="align-middle" style="width:80px;">日期</th>
          <th class="center">签到</th>
          <th class="center">志愿</th>
          <th class="center">借阅</th>
          <th class="center">还书</th>
          <th class="center">状态</th>
        </tr>
        </thead>
        <tbody>          
          @foreach ($activities as $i=>$activity)   
          <?php
              if($i == $paging) break;
              $user = $activities->shift();
          ?>
          <tr class="bank act-status{{$activity->status}}">
            <td class="align-middle act">
              <div class="nowrap"><a href="{{ route('activity.edit',array('aid'=>$activity->id)) }}">{!! $activity->present()->showtitle !!}</a></div>
            </td>
            <td class="align-middle"><span class="smaller-80">{!! $activity->present()->showDate !!}</span></td>
            <td class="center">
              <a href="{{route('activity.show', array('aid'=>$activity->id,'action'=>'joins'))}}" class=" b-sign">{{$activity->joins_count }}</a>
            </td>
            <td class="center">
              <a href="{{route('activity.show', array('aid'=>$activity->id,'action'=>'acts'))}}" class=" b-point">{{$activity->acts_count }}</a>
            </td>
            <td class="center">
              <a href="{{route('activity.show', array('aid'=>$activity->id,'action'=>'borrows'))}}" class=" b-borrow">{{$activity->borrows_count }}</a>
            </td>
            <td class="center">
              <a href="{{route('activity.show', array('aid'=>$activity->id,'action'=>'returns'))}}" class=" b-return">{{$activity->returns_count }}</a>
            </td>
            <td class="center">{!! $activity->present()->activityStatus !!}</td>
          </tr>
          
        @endforeach
        </tbody>
      </table>
    </div>

    <div class="col-xs-12 col-md-6">
      <table class="table table-hover table-striped table-bordered nonborder">
        <thead>
        <tr>
          <th class="align-middle">主题</th>          
          <th class="align-middle" style="width:80px;">日期</th>
          <th class="center">签到</th>
          <th class="center">志愿</th>
          <th class="center">借阅</th>
          <th class="center">还书</th>
          <th class="center">状态</th>
        </tr>
        </thead>
        <tbody>          
          @foreach ($activities as $i=>$activity)  
          <tr class="bank">
            <td class="align-middle act">
              <div class="nowrap"><a href="{{ route('activity.edit',array('aid'=>$activity->id)) }}">{!! $activity->present()->showtitle !!}</a></div>
            </td>
            <td class="align-middle"><span class="smaller-80">{!! $activity->present()->showDate !!}</span></td>            
            <td class="center">
              <a href="{{route('activity.show', array('aid'=>$activity->id,'action'=>'joins'))}}" class=" b-sign">{{$activity->joins_count }}</a>
            </td>
            <td class="center">
              <a href="{{route('activity.show', array('aid'=>$activity->id,'action'=>'acts'))}}" class=" b-point">{{$activity->acts_count }}</a>
            </td>
            <td class="center">
              <a href="{{route('activity.show', array('aid'=>$activity->id,'action'=>'borrows'))}}" class=" b-borrow">{{$activity->borrows_count }}</a>
            </td>
            <td class="center">
              <a href="{{route('activity.show', array('aid'=>$activity->id,'action'=>'returns'))}}" class=" b-return">{{$activity->returns_count }}</a>
            </td>
            <td class="center">{!! $activity->present()->activityStatus !!}</td>
          </tr>
          
        @endforeach
        </tbody>
      </table>
    </div>

  </div>
  
  <div class="row">
    <div class="col-xs-12">
      <div class="dataTables_paginate paging_bootstrap">{{ $activities->links() }}</div>
    </div>
  </div>
@stop

@section('javascript')
  
  <script type="text/javascript">
      $(function () {
          $('#query').focus();

      });
  </script>
@stop
